package com.springboot.dubbo.provider.utils;

import com.springboot.dubbo.provider.api.bean.LoginUserDTO;

public class LoginUserUtils {

    private static final String OPERATOR_USER_INFO = "operator_user_info";

    public static void setUserInfo(LoginUserDTO loginUserDTO){
        ThreadLocalContainer.set(OPERATOR_USER_INFO,loginUserDTO);
    }


    public static LoginUserDTO getUserInfo(){
        Object object = ThreadLocalContainer.get(OPERATOR_USER_INFO);
        if(object == null){
            return null;
        }
        return (LoginUserDTO)object;
    }

    public static void clean() {
        ThreadLocalContainer.clean();
    }

}
